<template>
	<div>
		<top-menu></top-menu>
		<notification></notification>
		<transition name="fade" mode="out-in">
			<router-view></router-view>
		</transition>
	</div>
</template>

<script>
import TopMenu from "./common/TopMenu";
import Notification from "./common/Notification";
import JWTToken from "../helpers/jwt";
import Cookies from "js-cookie";
export default {
	created() {
		if (!!JWTToken.getToken()) {
			this.$store.dispatch("setAuthUser");
		} else if (!!Cookies.get("auth_id")) {
			this.$store.dispatch("refreshToken");
		} else {
      this.$router.push('/#')
    }
	},
	components: {
		TopMenu,
		Notification
	}
};
</script>
